using System;
using System.ComponentModel.DataAnnotations;

namespace EIMS.Models.ViewModels
{
    public class SupplierContactViewModel
    {
        public int Id { get; set; }
        
        [Required(ErrorMessage = "供应商ID不能为空")]
        public int SupplierId { get; set; }
        
        [Display(Name = "供应商名称")]
        public string? SupplierName { get; set; }
        
        [Required(ErrorMessage = "联系人姓名不能为空")]
        [StringLength(50, ErrorMessage = "联系人姓名不能超过50个字符")]
        [Display(Name = "联系人姓名")]
        public string? Name { get; set; }
        
        [StringLength(50, ErrorMessage = "职位不能超过50个字符")]
        [Display(Name = "职位")]
        public string? Position { get; set; }
        
        [Required(ErrorMessage = "电话号码不能为空")]
        [StringLength(20, ErrorMessage = "电话号码不能超过20个字符")]
        [RegularExpression(@"^1[3-9]\d{9}$|^0\d{2,3}-\d{7,8}$", ErrorMessage = "请输入有效的电话号码")]
        [Display(Name = "电话号码")]
        public string? PhoneNumber { get; set; }
        
        [EmailAddress(ErrorMessage = "请输入有效的邮箱地址")]
        [StringLength(100, ErrorMessage = "邮箱不能超过100个字符")]
        [Display(Name = "邮箱")]
        public string? Email { get; set; }
        
        [Display(Name = "默认联系人")]
        public bool IsDefault { get; set; }
        
        [StringLength(500, ErrorMessage = "备注不能超过500个字符")]
        [Display(Name = "备注")]
        public string? Remarks { get; set; }
    }
} 